<?php
require(dirname(__FILE__) .'/check.php');
$skin->CheckIframe();



// 用户检测
$MB->Open('','login');

$MB->IsAdminRight('alertBack');


switch ($mudi){
	case 'del':
		del();
		break;

	case 'moreDel':
		MoreDel();
		break;

	default:
		die('err');
}

$MB->Close();
$DB->Close();





// 删除
function del(){
	global $DB;

	$dataID	= OT::GetInt2( OT::ParaArr('id') );

	$DB->Delete('memberOnline','MO_ID='. $dataID);

	JS::ParentHiddenEnd('data'. $dataID);
}



// 批量删除
function MoreDel(){
	global $DB,$dataType;

	$backURL	= OT::PostStr('backURL');
	$selDataID	= OT::Post('selDataID');

	$selCount = OT::NewCount($selDataID);
	if ($selCount <= 0){
		JS::AlertBackEnd('请先选择要删除的记录！');
	}

	$whereStr = '';
	for ($i=0; $i<$selCount; $i++){
		$whereStr .= ','. intval($selDataID[$i]);
	}
	if ($whereStr == ''){
		JS::AlertBackEnd('请先选择要删除的记录.');
	}


	$DB->Delete('memberOnline','MO_ID in (0'. $whereStr .')');

	JS::AlertHrefEnd('批量删除成功.',$backURL);

}
?>